import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '用户名',
    align: "center",
    dataIndex: 'name'
  },
  {
    title: '会员密码',
    align: "center",
    dataIndex: 'memberPassword'
  },
  {
    title: '性别',
    align: "center",
    dataIndex: 'gender_dictText'
  },
  {
    title: '生日',
    align: "center",
    dataIndex: 'birthday',
    customRender:({text}) =>{
      text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
      return text;
    },
  },
  {
    title: '头像',
    align: "center",
    dataIndex: 'avatarUrl',
    customRender: render.renderImage,
  },
  {
    title: '手机号',
    align: "center",
    dataIndex: 'phoneNumber'
  },
  {
    title: '简介',
    align: "center",
    dataIndex: 'description'
  },
  {
    title: '偏好',
    align: "center",
    dataIndex: 'preference_dictText'
  },
  {
    title: '积分',
    align: "center",
    dataIndex: 'points'
  },
  {
    title: '会员类别',
    align: "center",
    dataIndex: 'memberType_dictText'
  },
  {
    title: '启用状态',
    align: "center",
    dataIndex: 'isEnabled_dictText'
  },
  {
    title: '注册时间',
    align: "center",
    dataIndex: 'registerTime'
  },
];

// 高级查询数据
export const superQuerySchema = {
  name: {title: '用户名',order: 0,view: 'text', type: 'string',},
  memberPassword: {title: '会员密码',order: 1,view: 'text', type: 'string',},
  gender: {title: '性别',order: 2,view: 'list', type: 'string',dictCode: 'member_gender',},
  birthday: {title: '生日',order: 3,view: 'date', type: 'string',},
  avatarUrl: {title: '头像',order: 4,view: 'image', type: 'string',},
  phoneNumber: {title: '手机号',order: 5,view: 'text', type: 'string',},
  description: {title: '简介',order: 6,view: 'textarea', type: 'string',},
  preference: {title: '偏好',order: 7,view: 'checkbox', type: 'string',dictCode: 'product_type',},
  points: {title: '积分',order: 8,view: 'number', type: 'number',},
  memberType: {title: '会员类别',order: 9,view: 'list', type: 'string',dictCode: 'member_type',},
  isEnabled: {title: '启用状态',order: 10,view: 'number', type: 'number',dictCode: 'member_status',},
  registerTime: {title: '注册时间',order: 11,view: 'datetime', type: 'string',},
};
